const Home = {
  // 查询订单页的sql语句
  selectOrderData(option) {
    return `SELECT
    id,
    ordernumber_id,
    orderfrom_id,
    orderfrom_name,
  orderfrom_price,
  orderfrom_number,
  orderfrom_des,
  orderfrom_src
  FROM
    ordernumber,
    orderfrom
  WHERE
    ordernumber_user_id = ${option}
  AND id = orderfrom_ordernumber_id
  and ordernumber_status=0`
  },

  selectToBeShippedData(option) {
    return `SELECT
    id,
    ordernumber_id,
    orderfrom_id,
    orderfrom_name,
  orderfrom_price,
  orderfrom_number,
  orderfrom_des,
  orderfrom_src
  FROM
    ordernumber,
    orderfrom
  WHERE
    ordernumber_user_id = ${option}
  AND id = orderfrom_ordernumber_id
  and ordernumber_status=3`
  },

  // 查询用户的id
  selectUserId(option) {
    return `select user_id from user where user_phone= ${option.tel}`
  },

  // 查询订单号的id
  selectOrderId(id) {
    return `select id from ordernumber where ordernumber_id=${id}`
  },

  // 删除外键表数据
  delForeignKeyData(id) {
    return `Delete from orderfrom where orderfrom_ordernumber_id =${id}`
  },

  // 删除主键数据
  delKeyData(id) {
    return `Delete from ordernumber where id =${id}`
  },
}

exports = module.exports = Home
